package SpringBoot.spring_boot_starter_websocket.D02_服务端广播.config;

import java.io.IOException;

import org.springframework.boot.autoconfigure.websocket.TomcatWebSocketContainerCustomizer;
import org.springframework.boot.context.embedded.EmbeddedServletContainerFactory;
import org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainerFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;


/**
 *
 *
 * @author 周成功
 *
 */
@Configuration
public class JavaConfig {
    @Bean
    public EmbeddedServletContainerFactory tomcatEmbeddedServletContainerFactory() throws IOException {
        TomcatEmbeddedServletContainerFactory tomcat = new TomcatEmbeddedServletContainerFactory();
        return tomcat;
    }
    
    
    @Bean
    public TomcatWebSocketContainerCustomizer websocketContainerCustomizer() {
        return new TomcatWebSocketContainerCustomizer();
    }
    
    @Bean
    public WebSocketSessionConnectedEvent mySessionConnectedEvent(){
        return new WebSocketSessionConnectedEvent();
    }
}
